package tgc.edu.tgq.bootstrap.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;

import com.fasterxml.jackson.annotation.JsonIgnore;

import tgc.edu.tgq.bootstrap.custom.BaseEntity;
@Entity
//实体类角色
public class SysRole extends BaseEntity<Integer>{
	private String name;
	private String code;
	
	@JsonIgnore
	private List<SysUser> users=new ArrayList<>();
	
	public SysRole() {
		super();
	}
	public SysRole(Integer id) {
		super(id);
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	
	@ManyToMany(mappedBy = "roles")
	public List<SysUser> getUsers() {
		return users;
	}
	public void setUsers(List<SysUser> users) {
		this.users = users;
	}
	
	
}
